<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title> 欠款明细导出记录表 管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
             <div class="fieldBox">
                    <div class="label">客户名称</div>
                    <div class="field">
                        <input name="cstNm" id="cstNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                 <div class="fieldBox">
                    <div class="label">合同号</div>
                    <div class="field">
                        <input name="lsCntNo" id="lsCntNo" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">支付表号</div>
                    <div class="field">
                        <input name="paySchNo" id="paySchNo" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">制表时间</div>
                    <div class="field">
                         <div class="field">
                     <input name="stDt" id="stDt" type="text" class="ui-datepicker" value="">
                     <span>---</span>
                      <input name="endDt" id="endDt" type="text" class="ui-datepicker" value="">
             		  </div>
                    </div>
                </div>
                
                <div class="clearFix"></div>
                <div class="btnsBox">
                    <span id="searchBtn" class="sq-button sq-button-round">查询</span>
                    <span id="clearBtn" class="sq-button sq-button-round">清空</span>
                    <span id="payAmtExportBtn" class="sq-button sq-button-round">导出欠款明细</span>
                </div>
            </div>
        </form>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null,callback=null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/risk/rskArreExpLogM/initList.do',
            method: 'get',
            columns: [
                {display: '客户名称', name: 'cstNm', minWidth: 180, align: 'center', enabledSort: false},
                {display: '合同号', name: 'lsCntNo', minWidth: 100, align: 'center', enabledSort: false},
                {display: '支付表号', name: 'paySchNo', minWidth: 120, align: 'center', enabledSort: false},
                {display: '制表时间', name: 'crtTm', minWidth: 100, align: 'center', render:renderDate, enabledSort: false},
                {display: '截止时间', name: 'closDt', minWidth: 100, align: 'center',render:renderDate, enabledSort: false},
                {display: '违约金计算方式', name: 'penaCalWayNm', minWidth: 180, align: 'center', enabledSort: false},
                {display: '制表人', name: 'crtUsrName', minWidth: 100, align: 'center', enabledSort: false},
                {
                    display:'操作',width:250,
                    render:function (rowdata, rowindex, value){
                        var h="";
                        h+='<a class="sq-button-hasicon" href="javascript:payDetail(';
                        h+="'"+rowdata.id+"'";
                        h+=")\"><i class='sqBtnIco_32'></i>欠款明细</a>";
                        return h;
                    }
                }
		
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            //isScroll: false,
            checkbox: true,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: false
            /* onRenderComplete: function () {
             iframeResize ();
             } */
        });
        grid.setHeight(100);

        $("#searchBar").ligerForm();

        $("#pageloading").hide();

        /* 查询 */
        $("#searchBtn").click(function (event) {
            var form = liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });

        /* 清空 */
        $("#clearBtn").click(function (event) {
            clearLigerForm("searchBar");
        });
        
        callback = function () {
            grid.reload();
        };

        /* 导出 */
        $("#payAmtExportBtn").click(function (event) {
            $.ligerDialog.open({
                width: 800,
                height: 550,
                title: '欠款明细导出记录',
                url:'<%=path%>/risk/rskArreExpLogM/toExportPage.do'
            });
        });
    });


    /* 详情 */
    function payDetail(id) {
        Add_navTab("rskArreExpLogM"+id, "欠款明细导出记录详情", '<%=path%>/risk/rskArreExpLogM/toDetailPage.do?id='+id);
    }

  //格式化时间
	function renderDate(rowdata, index, value){
		var dateStr = "";
		if(null != value&&value!=''){
			var date = new Date(value);
			dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
		}
		return dateStr;
	}

</script>

</body>
</html>
